package com.ruoyi.asms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.asms.domain.AssetFullInfoView;
import com.ruoyi.asms.mapper.AssetFullInfoViewMapper;
import com.ruoyi.asms.service.IAssetFullInfoViewService;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资产详细信息视图Service业务层处理
 * 
 * @author yfkj
 * @date 2021-10-28
 */
@Service
public class AssetFullInfoViewServiceImpl extends ServiceImpl<AssetFullInfoViewMapper, AssetFullInfoView>  implements IAssetFullInfoViewService
{
    @Autowired
    private AssetFullInfoViewMapper assetFullInfoViewMapper;

    /**
     * 查询资产详细信息视图
     * 
     * @param maintenanceAssetId 资产详细信息视图主键
     * @return 资产详细信息视图
     */
    @Override
    public AssetFullInfoView selectAssetFullInfoViewByMaintenanceAssetId(Long maintenanceAssetId)
    {
        return assetFullInfoViewMapper.selectAssetFullInfoViewByMaintenanceAssetId(maintenanceAssetId);
    }

    /**
     * 查询资产详细信息视图列表
     * 
     * @param assetFullInfoView 资产详细信息视图
     * @return 资产详细信息视图
     */
    @Override
    public List<AssetFullInfoView> selectAssetFullInfoViewList(AssetFullInfoView assetFullInfoView)
    {
        return assetFullInfoViewMapper.selectAssetFullInfoViewList(assetFullInfoView);
    }

    /**
     * 新增资产详细信息视图
     * 
     * @param assetFullInfoView 资产详细信息视图
     * @return 结果
     */
    @Override
    public int insertAssetFullInfoView(AssetFullInfoView assetFullInfoView)
    {
        assetFullInfoView.setCreateTime(System.currentTimeMillis());
        assetFullInfoView.setCreateBy(SecurityUtils.getUsername());
        return assetFullInfoViewMapper.insertAssetFullInfoView(assetFullInfoView);
    }

    /**
     * 修改资产详细信息视图
     * 
     * @param assetFullInfoView 资产详细信息视图
     * @return 结果
     */
    @Override
    public int updateAssetFullInfoView(AssetFullInfoView assetFullInfoView)
    {
        assetFullInfoView.setUpdateTime(System.currentTimeMillis());
        assetFullInfoView.setUpdateBy(SecurityUtils.getUsername());

        return assetFullInfoViewMapper.updateAssetFullInfoView(assetFullInfoView);
    }

    /**
     * 批量删除资产详细信息视图
     * 
     * @param maintenanceAssetIds 需要删除的资产详细信息视图主键
     * @return 结果
     */
    @Override
    public int deleteAssetFullInfoViewByMaintenanceAssetIds(Long[] maintenanceAssetIds)
    {
        return assetFullInfoViewMapper.deleteAssetFullInfoViewByMaintenanceAssetIds(maintenanceAssetIds);
    }

    /**
     * 删除资产详细信息视图信息
     * 
     * @param maintenanceAssetId 资产详细信息视图主键
     * @return 结果
     */
    @Override
    public int deleteAssetFullInfoViewByMaintenanceAssetId(Long maintenanceAssetId)
    {
        return assetFullInfoViewMapper.deleteAssetFullInfoViewByMaintenanceAssetId(maintenanceAssetId);
    }
}
